package com.showtao.common.security.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.showtao.common.security.domain.Role;

public interface RoleRepository extends JpaRepository<Role, String> {
    
    @Query("select distinct r from Role r left join r.permissions")
    Page<Role> findAllLeftJoinPermissions(Pageable pageable);
    
}
